package com.wans.apis.config;

import feign.RequestInterceptor;
import feign.RequestTemplate;

public class BrowserEmulationInterceptor implements RequestInterceptor {
    @Override
    public void apply(RequestTemplate template) {
        // 添加浏览器标准请求头
        template.header("Accept", "application/json, text/plain, */*");
        template.header("Accept-Language", "zh-CN,zh;q=0.9,en;q=0.8");
        template.header("Connection", "keep-alive");
        template.header("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36");
        template.header("Content-Type", "application/json;charset=UTF-8");
        template.header("Referer", "https://api.huiniao.top/");
        template.header("Sec-Fetch-Mode", "cors");
        template.header("Sec-Fetch-Site", "same-origin");
    }
}